<template>
    <div class="contain" @click="handleClickclose">
        <swiper class="swiper" :options="swiperOption">
            <swiper-slide v-for="(item,index) of gallaryImgs" :key="index">
                <img :src="item">
            </swiper-slide>
            <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
    </div>
</template>
<script>
export default {
  name: 'CommonGallery',
  props: {
    gallaryImgs: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleClickclose () {
      this.$emit('close')
    }
  }
}
</script>
<style lang="stylus" scoped>
.contain {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    z-index: 999;

    .swiper {
        margin-top: 2.5rem;

        img {
            width: 100%;
            height: 5rem;
        }

        .swiper-pagination {
            color: #fff;
        }
    }
}
</style>
